<script language="javascript" src="../js/hotelLib.js" type="text/javascript"></script>

<?php

	$objHabitacionesHotel = new HabitacionesHotel();

	$profile=get_object_vars(unserialize($_SESSION['userProfile']));
	$idProcedencia = $profile['data']['id_procedencia'];
	$habitaciones = $objHabitacionesHotel->getHabitacionesFrom($idProcedencia);
	
	// Hotel
	$seccion = 4;
	
////	if($_SESSION['Tipo']=='Operadora'){
////		$esOperadora = true;
////		$action = "controladorOperadora.php";	
////		$seccion = 1;
////	}else if($_SESSION['Tipo']=='Hotel'){
////		$esHotel = true;
////		$action = "controladorHotel.php";
////		$seccion = 4;
////	}else if($_SESSION['Tipo']=='Agencia'){
////		$esAgencia = true;
////		$action = "controladorAgencia.php";
////		$seccion = 6;
////	}

?>
	<?php	
		if (isset($_GET['msg'])){
	?>
			<table width="100%" border="0">
				<tr>
					<td align="center">
						<div style="background-color:#CCCCCC; border:1px solid #999999; font-family:sans-serif, Arial, Helvetica ; font-size:12px; font-style:italic; font-weight:bold; color:#996600; word-spacing:5px" align="center">
						<?php
							require '../Comun/ss_messages.php';
						?>
						</div>
					</td>
				</tr>
			</table>
	<?php
		}
	?>



<?php	
	
	echo "
	<form name='form' id='formaAdmin' action='ss_Habitaciones.php' method='post'>
		<input type='hidden' value='{$seccion}' name='seccion' />
		<input type='hidden' value='' name='accion' />
		<input type='hidden' value='' name='id' />
		<input type='hidden' value='' name='tipo' />
				
		<table width='600' border='1' align='center' cellpadding='0' cellspacing='0'>
			<tr>
				<th class='formLabel' scope='col'>Tipo</th>
				<th class='formLabel' scope='col'>Ocupacion</th>	
				<th class='formLabel' scope='col'>No. Menores</th>
				<th class='formLabel' scope='col'>No. Juniors</th>	
				<th class='formLabel' scope='col'>No. Indiferente</th>
				<th class='formLabel' scope='col'>Descripcion</th>												
				<th class='formLabel' scope='col'>Modif.</th>
				<th class='formLabel' scope='col'>Elim.</th>
			</tr>";
	
	foreach($habitaciones as $hh){
		$tipox = $objHabitacionesHotel->getTipoHabitacion($hh['Id_Tipo']);
		echo "
			<tr>
				<td >".$tipox['Nombre']."&nbsp;</td>
				<td >".$hh['Ocupacion']."&nbsp;</td>			
				<td >".$hh['Numero_Menores']."&nbsp;</td>		
				<td >".$hh['Numero_Juniors']."&nbsp;</td>
				<td >".$hh['Numero_Indiferente']."&nbsp;</td>	
				<td >".$hh['Descripcion']."&nbsp;</td>																
				<td align='center' width='60'>
					<img border='0' style=\"vertical-align:middle;\" src='../images/edit.jpg' value='Modificar' alt='Modificar' onClick=\"validarAdmHabitacion({$hh['Id_Habitacion']}, '{$hh['Ocupacion']}', 'ss_Habitaciones.php','mod');\" onMouseOver=\"this.style.border='1px outset #000000';\" onMouseOut=\"this.style.border='0px outset #CCCCCC';\" >
				</td>";

		$able = '';
		if($u['Privilegios'] == 'Administrador' && !$esOperadora) $able = "disabled='disabled' class=\"opaco\"";
		if($u['Privilegios'] == 'Administrador de Operadora') $able = "disabled='disabled' class=\"opaco\"";

			echo "
				<td align='center' width='50'>
					<img border='0' src='../images/erase.jpg' alt='Eliminar' onclick=\"validarAdmHabitacion({$hh['Id_Habitacion']}, '{$hh['Ocupacion']}', 'ss_ConsultarHabitaciones.php','del');\" {$able}
					onMouseOver=\"this.style.border='1px outset #000000';\" onMouseOut=\"this.style.border='0px outset #CCCCCC';\"
					>
				</td> 
			</tr>";
	}
	echo "
		</table>
	</form>";
?>